package com.blb.zy_community.mapper;

import com.blb.zy_community.entity.SysRoleDept;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 角色和部门关联表 Mapper 接口
 * </p>
 *
 * @author 二组
 * @since 2023-06-18
 */
@Mapper
public interface SysRoleDeptMapper extends BaseMapper<SysRoleDept> {
    /**
     * 根据角色id查询部门
     */
    @Select("select dept_id from sys_role_dept where role_id = #{roleId}")
    List<Long> selectDeptByRoleId(Long roleId);
}
